﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BoAddonBiz_FreightForwarder.ObjectFind
{
    class ObjectFind
    {
        #region fields
        private string _ObjectCode;
        private string _ObjectName;
        private ObjectFindLines _Lines;
        #endregion
        #region propertes
        public string ObjectCode
        {
            set
            {
                _ObjectCode = value;
                _Lines.ObjectType = _ObjectCode;
            }
            get { return _ObjectCode; }
        }
        public string ObjectName
        {
            set { _ObjectName = value; }
            get { return _ObjectName; }
        }
        public ObjectFindLines Lines
        {
            get { return _Lines; }
        }
        #endregion
        #region constructor
        public ObjectFind()
        {
            _Lines = new ObjectFindLines();
        }
        #endregion
        #region methods
        public ObjectFindLine GetObjectFindLine(string TableName, string Field)
        {
            foreach (ObjectFindLine oFindLine in Lines)
            {
                if (oFindLine.TableName == TableName && oFindLine.Field == Field)
                {
                    return oFindLine;
                }
            }
            return null;
        }
        #endregion

    }
}
